SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


create procedure dbo.DnnProduct_GetHtmlTextLog

@ItemID int

as

select DnnProduct_HtmlTextLog.ItemID,
       DnnProduct_HtmlTextLog.StateID,
       DnnProduct_WorkflowStates.StateName,
       DnnProduct_HtmlTextLog.Comment,
       DnnProduct_HtmlTextLog.Approved,
       DnnProduct_HtmlTextLog.CreatedByUserID,
       DnnProduct_Users.DisplayName,
       DnnProduct_HtmlTextLog.CreatedOnDate
from dbo.DnnProduct_HtmlTextLog
inner join dbo.DnnProduct_WorkflowStates on dbo.DnnProduct_HtmlTextLog.StateID = dbo.DnnProduct_WorkflowStates.StateID
left outer join dbo.DnnProduct_Users on dbo.DnnProduct_HtmlTextLog.CreatedByUserID = dbo.DnnProduct_Users.UserID
where ItemID = @ItemID
order by DnnProduct_HtmlTextLog.CreatedOnDate desc

GO
